From d87ab990c1aaa7d083a49081e8b33b8d10a88f7f Mon Sep 17 00:00:00 2001 From: David Scott Date: Thu, 9 Oct 2014 10:17:30 +0100 Subject: [PATCH] xl: 'replace_string' now uses xstrdup This catches the out-of-memory exception and exits the program. Signed-off-by: David Scott Acked-by: Wei Liu --- tools/libxl/xl_cmdimpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index be809c8fb4..70d70bdfb0 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -839,7 +839,7 @@ static void parse_vcpu_affinity(libxl_domain_build_info *b_info, static void replace_string(char **str, const char *val) { free(*str); - *str = strdup(val); + *str = xstrdup(val); } static void parse_config_data(const char *config_source, -- 2.30.2